package com.avery.imp;

import java.util.List;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import com.avery.dao.ITaskDao;
import com.avery.entity.Task;

public class TaskDaoImp extends SqlSessionDaoSupport implements ITaskDao {

	public void insert(Task task) {
		
		getSqlSession().insert("com.avery.entity.Task.insert", task);
		
	}

	public void deleteByID(int id) {
		
		getSqlSession().delete("com.avery.entity.Task.delete", id);
		
	}

	public void update(Task task) {
		
		getSqlSession().update("com.avery.entity.Task.update", task);
		
	}

	public List<Task> getAllTasksByUserID(int uid) {
		
		List<Task> tasks = getSqlSession().selectList("com.avery.entity.Task.selectAllByUserId", uid);
		
		return tasks;
	}

	public List<Task> getAllTasksByToday() {
//		
//		List<Task> tasks = getSqlSession().selectList("com.avery.entity.Task.selectAllByUserId", uid);
//		
		return null;
	}

	public List<Task> getAllTasksByTargetDay(String date) {
		// TODO Auto-generated method stub
		return null;
	}

}
